"""Build daos engine tests"""
import daos_build

def scons():
    """Execute build"""
    Import('denv', 'prereqs')

    unit_env = denv.Clone()

    prereqs.require(unit_env, 'pmdk', headers_only=True)

    unit_env.Append(RPATH_FULL=['$PREFIX/lib64/daos_srv'])
    unit_env.Append(CPPDEFINES=['-DDAOS_PMEM_BUILD'])
    srv_checksum_tests = daos_build.test(unit_env, 'srv_checksum_tests',
                                         ['srv_checksum_tests.c',
                                          '../srv_csum.c'],
                                         LIBS=['daos_common_pmem', 'gurt',
                                               'cmocka', 'vos', 'bio', 'abt'])
    unit_env.Install('$PREFIX/bin/', [srv_checksum_tests])

if __name__ == "SCons.Script":
    scons()
